<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="UTF-8">
    <title>图书管理系统</title>
    <link rel="stylesheet" th:href="@{https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css}">
    <script th:src="@{https://code.jquery.com/jquery-3.5.1.min.js}"></script>
    <style>
        nav {
            font-size: 1.5rem;
            background-color: #21D4FD;
            background-image: -webkit-linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
            background-image: -moz-linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
            background-image: -o-linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
            background-image: linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
        }
        h1 {
            font-size: 2rem;
            color: white;
        }
        li {
            margin: 10px 20px;
        }
        th {
            width: 100px;
        }
        label {
            margin: auto;
            padding-right: 20px;
        }
        .input-group {
            padding-top: 13px;
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-expand-sm bg-primary navbar-dark">
    <ul class="navbar-nav">
        <li>
            <h1><a th:href="@{/}" style="color: white; text-decoration: none">图书管理系统</a></h1>
        </li>
        <li class="nav-item">
            <a class="nav-link" th:href="@{/admin/book}">图书管理</a>
        </li>
        <li class="nav-item">
            <a class="nav-link active" th:href="@{/admin/user}">读者管理</a>
        </li>
        <li class="nav-item">
            <a class="nav-link" th:href="@{/admin/order}">借还管理</a>
        </li>
    </ul>
    <div class="text-white" style="font-size: medium; position: absolute; bottom: 30px; right: 40px">
        <div class="dropdown">
            <a >
                欢迎
                <span sec:authentication="principal.authorities"></span>
                <span sec:authentication="name"></span>
            </a>
            <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                <a class="dropdown-item" th:href="@{/user/toInfoPage}" sec:authorize="hasRole('USER')">个人信息</a>
                <a class="dropdown-item" th:href="@{/toChPwdPage}">修改密码</a>
                <a class="dropdown-item" th:href="@{/logout}">注销</a>
            </div>
        </div>
    </div>
</nav>

<div class="container">
    <form th:method="post" th:object="${Object}" th:action="@{/admin/modifyUser/}">
        <div class="input-group">
            <label for="userId">ID</label>
            <input type="text" class="form-control" id="userId" name="userId" th:value="${c.getUserId()}">
        </div>
        <div class="input-group">
            <label for="userName">昵称</label>
            <input type="text" class="form-control" id="userName" name="userName" th:value="${c.getUserName()}">
        </div>
        <div class="input-group">
            <label for="userTel">电话</label>
            <input type="text" class="form-control" id="userTel" name="userTel" th:value="${c.getUserTel()}">
        </div>
        <div class="input-group">
            <label for="userEnabled">权限</label>
            <textarea class="form-control" id="userEnabled" name="userEnabled" th:text="${c.getUserEnabled()}"></textarea>
        </div>
        <div class="input-group">
            <label for="userClass">班级代码</label>
            <input type="text" class="form-control" id="userClass" name="userClass">
        </div>
        <div class="input-group">
            <label for="userPassword">密码</label>
            <input type="text" class="form-control" id="userPassword" name="userPassword" th:value="${c.getUserPassword()}">
        </div>
        <input type="submit"  value="提    交" class="btn btn-outline-primary btn-lg">
        <a th:href="@{/admin}" class="btn btn-outline-secondary btn-lg" style="margin-left: 40px">取&nbsp;&nbsp;&nbsp;&nbsp;消</a>
    </form>
</div>

<script th:src="@{https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js}"></script>
<script th:src="@{https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js}"></script>
<script th:src="@{https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js}"></script>
</body>
</html>